<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!--引入三件套-->
    <!--引入vue.js-->
    <script src="js/plugins/vue/dist/vue.js"></script>
    <script src="js/plugins/axios/dist/axios.js"></script>
    <script src="js/plugins/common.js"></script>

</head>
<body>

    <h1 id="app">.....微信回调.....</h1>

</body>

    <script>

        new Vue({
            el:"#app",
            data:{

            },
            methods:{

            },
            mounted(){
                let param = getParamByUri();

                console.debug("param:",param);
                console.debug("param.code:",param.code);
                this.$http.post("/wxUser/wxLogin",param).then(res=>{
                    console.debug(res);
                    let {success,message,resultObj} = res.data;
                    if(success) {// 老用户登录
                        //	将登陆信息存储到localStorage
                        localStorage.setItem("TOKEN",resultObj.token);
                        localStorage.setItem("loginInfo",JSON.stringify(resultObj.loginInfo));
                        //	跳转到首页
                        location.href = "index.html";
                    }else {
                        //	新用户登录
                        location.href = resultObj;
                    }
                })
            }
        });


    </script>



</html>